package com.lagou.nio;

import java.nio.ByteBuffer;

/**
 * @Classname NioByteBufferGet
 * @Description TODO
 * @Date 2020/7/24 12:39
 * @Created by pc
 */
public class NioByteBufferGet {

    public static void main(String[] args) {
        ByteBuffer buffer = ByteBuffer.allocate(50);

        buffer.putInt(1);
        buffer.putFloat(2.0f);
        buffer.putChar('中');
        buffer.putLong(2l);

        buffer.flip();

        System.out.println(buffer.getInt());
        System.out.println(buffer.getFloat());
        System.out.println(buffer.getChar());
        System.out.println(buffer.getLong());

    }
}
